package cn.com.HiSting1990.MyCompany;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class MyIOTest {
    public static void main(String[] args) throws FileNotFoundException {
        //new FileInputStream("C:\\Dev\\testFiles\\久久美剧网.txt")
        File file = new File("C:\\Dev\\testFiles\\久久美剧网.txt");
        StringBuffer stringBuffer = new StringBuffer();
        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
            String s = null;
            //使用readLine方法，一次读一行
            while ((s = bufferedReader.readLine()) != null){
                stringBuffer.append(System.lineSeparator()+s);
            }
            bufferedReader.close();
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println(stringBuffer.toString());
    }
}
